package org.yangjie.config.security;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter;
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;

/**
 * 登录认证过滤器
 * 模仿#org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter
 * 使用session来维护登录状态的应用使用此方式
 * @author YangJie [2019年1月17日]
 */
public class SessionAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter{

	public SessionAuthenticationProcessingFilter() {
		super(new AntPathRequestMatcher("/auth", "POST"));
	}

	@Override
	public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response)
			throws AuthenticationException, IOException, ServletException {
		return null;
	}

}
